<template>
  <div class="details">
    <Viewer :value="value" :plugins="plugins" />
  </div>
</template>

<script setup lang="ts">
import gfm from "@bytemd/plugin-gfm";
import highlight from "@bytemd/plugin-highlight";
import { Viewer } from "@bytemd/vue-next";
import { withDefaults, defineProps, ref } from "vue";
//import zhHans from "bytemd/lib/locales/zh_Hans.json";

const plugins = [
  // 在这里添加文本编辑器的组件
  gfm(),
  highlight(),
];

/**
 * 定义组件属性类型
 */
interface Props {
  value: string;
}

/**
 * 给组件定义初始值
 */
const props = withDefaults(defineProps<Props>(), {
  value: () => "",
});
</script>

<style>
.details {
}
</style>
